﻿@model AccountDropdownModel

@{
    var isRtl = this.WorkContext.WorkingLanguage.Rtl;
}

<div sm-if="Model.IsAuthenticated" class="dropdown-menu @(isRtl ? "dropdown-menu-left" : "dropdown-menu-right")">
    <zone name="account_dropdown_before"></zone>

    @foreach (var item in Model.MenuItems)
    {
        var isLogoutDivider = item.IsGroupHeader && item.Id.EqualsNoCase("logout-divider");
        if (isLogoutDivider)
        {
            <zone name="account_dropdown_logout_divider_before"></zone>
        }

        <div sm-if="item.IsGroupHeader" class="dropdown-divider"></div>

        if (isLogoutDivider)
        {
            <zone name="account_dropdown_logout_divider_after"></zone>
        }

        <a href="@item.GenerateUrl(Url)" attrs="item.LinkHtmlAttributes">
            <i class="@item.Icon"></i>
            <span>@item.Text</span>
            @if (item.BadgeText != null)
            {
                <span class="badge badge-@(((BadgeStyle)item.BadgeStyle).ToString().ToLower())" attrs="item.BadgeHtmlAttributes">
                    @item.BadgeText
                </span>
            }
        </a>
    }

    <zone name="account_dropdown_after"></zone>
</div>